using ChatBackend.Models;

namespace ChatBackend.Repositories
{
    public interface IMessageRepository
    {
        Task<Message?> GetByIdAsync(int id);
        Task<List<Message>> GetChatRoomMessagesAsync(int chatRoomId, int pageNumber = 1, int pageSize = 50);
        Task<Message?> GetLastMessageAsync(int chatRoomId);
        Task<int> GetUnreadCountAsync(int chatRoomId, int userId, DateTime? lastReadAt);
        Task<Message> CreateAsync(Message message);
        Task<Message> UpdateAsync(Message message);
        Task<bool> DeleteAsync(int id);
        Task<bool> SoftDeleteAsync(int id);
        Task<bool> ExistsAsync(int id);
        Task<int> GetTotalMessagesCountAsync(int chatRoomId);
        Task<List<Message>> SearchMessagesAsync(int chatRoomId, string searchTerm);
    }
}
